<?php 
include("lang.php");
require("config.php");
function getUserName($id) {
    $sql="select * from users where id=$id";
    $res = mysql_query($sql);
    $row = @@mysql_fetch_object($res);
    $val = "$row->nom $row->prenom";
    $val=strtoupper($val);
    return $val;
}
if(isset($_GET["cur"]))
{
 $val=$_GET["cur"];
}
if(isset($val))
{
if($val==1){
	$class_1="current";
}elseif($val==2){
	$class_2="current";
}elseif($val==3){
    $class_3="current";
}elseif($val==4){
    $class_4="current";
}elseif($val==5){
    $class_5="current";
}elseif($val==6){
    $class_6="current";
}elseif($val==7){
    $class_7="current";
}elseif($val==8){
    $class_8="current";
}elseif($val==9){
    $class_9="current";
}elseif($val==10){
    $class_10="current";
}
}


?>
<div id="menu-container">
<?php 
if($_SESSION["profil"]=="ADMIN"){?>

<ul id="simple-menu">

    <li><a href="ad_acc.php?cur=1"  class="<?php echo $class_1;?>"><?php echo TXT_MENU_1;?></a></li>
  <li><a href="ad_users.php?cur=2" class="<?php echo $class_2;?>"><?php echo TXT_MENU_2;?></a></li>
     <li><a href="ad_forms.php?cur=3" class="<?php echo $class_3;?>"><?php echo TXT_MENU_3;?></a></li>
     <li><a href="ad_contents.php?cur=4" class="<?php echo $class_4;?>"><?php echo TXT_MENU_4;?></a></li>
     <li><a href="ad_rappels.php?cur=5" class="<?php echo $class_5;?>"><?php echo TXT_MENU_5;?></a></li>
    <li><a href="logout.php" title="Quitter"><?php echo TXT_MENU_6;?></a></li>
    <li><img src="img/orange.gif" width="250px" height="1px"><?php $id =$_SESSION["id_user"]; echo getUserName($id);?><img src="img/photo.jpg">
        </li>
       
</ul>
    

<?php }
if($_SESSION["profil"]=="USER"){
    $type_prog = $_SESSION["type_prog"];
?>
<ul id="simple-menu">

    <li><a href="ad_acc.php?cur=1"  class="<?php echo $class_1;?>"><?php echo TXT_MENU_1;?></a></li>
  <li><a href="form_<?php echo $type_prog;?>.php?cur=2&type_prog=<?php echo $type_prog;?>" class="<?php echo $class_2;?>"><?php echo TXT_MENU_8;?></a></li>
     <li><a href="liste_forms.php?cur=3" class="<?php echo $class_3;?>"><?php echo TXT_MENU_9;?></a></li>
   <li><a href="logout.php" title="Quitter"><?php echo TXT_MENU_6;?></a></li>
   <li><img src="img/orange.gif" width="350px" height="1px"><?php $id =$_SESSION["id_user"]; echo getUserName($id);?><img src="img/photo.jpg">
        </li>
        <a href="profil.php?cur=4&id=<?php echo $id;?>&action=mod_user"><?php echo TXT_MENU_10;?></a>
</ul>

    
    <?php }?>
</div>